package com.ruoyi.common.core.mybatisplus.core;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 自定义 Mapper 接口, 实现 自定义扩展
 *
 * @author Lion Li
 * @since 2021-05-13
 */
public interface BaseMapperPlus<T> extends BaseMapper<T> {

	int insertAll(@Param("list") Collection<T> batchList);



	@Select("${sql} limit #{pageIndex},#{pageSize}")
	public List<Map> findPageList(Map prams);

	@Select("${sql}")
	public List<Map> findList(Map prams);

	@Select("${sql} limit #{pageIndex},#{pageSize}")
	public List<T> findPageListEnty(Map prams);

	@Select("${sql}")
	public LambdaQueryWrapper<T> findListEnty(Map prams);

	@Select("${sql}")
	public List<Object> findObjList(Map prams);

	@Select("${sql}")
	public List<String> findStrList(Map prams);

	@Select("select count(*) from (${sql}) t")
	public int findListCount(Map prams);


	@Select("${sql}")
	public Map getMap(Map prams);

	@Select("${sql}")
	public String getString(Map prams);

	@Select("${sql}")
	public T getEnty(Map prams);

	@Select("${sql}")
	public List<Map<String, String>> getListMap(Map prams);

	@Select("${sql}")
	public Integer getCount(Map prams);
	@Select("${sql}")
	public Object getVoEntity(Map prams);

}
